home *** CD-ROM | disk | FTP | other *** search
- /*
- File: EntireContents.h
-
- Contains: Code for 'entire contents' property
-
- Written by: Greg Anderson
-
- Copyright: © 1993-1995 by Apple Computer, Inc., all rights reserved.
-
- <8> 6/6/95 ga
- */
-
- #ifndef __ENTIRECONTENTS__
- #define __ENTIRECONTENTS__
- #define EntireContents_h
-
-
- #define cEntireContents 'ects'
-
- //
- // ProxyToken.h is needed because
- // TProxyToken is the base class of TEntireContents
- //
- #include "ProxyToken.h"
-
- //
- // AbstractIterator is needed because TAbstractIterator
- // is the base class of TDeepIterator
- //
- #include "AbstractIterator.h"
-
-
- class TEntireContents : public TProxyToken
- {
- public:
- DeclareSmallClassData(TEntireContents, TProxyToken);
-
- TEntireContents();
- virtual ~TEntireContents();
-
- void IEntireContents(TAbstractScriptableObject* rootIcon);
-
- virtual DescType ObjectClass(const TAETransaction& t, Boolean recordedClass = false);
- virtual Boolean DerivedFromOSLClass(const TAETransaction& t, DescType objectClass);
-
- virtual Boolean PropertyAppliesToProxy(DescType propertyName);
- virtual TAbstractObjectIterator* ElementIterator(const TAETransaction&);
-
- private:
-
- TAbstractScriptableObject* fRootItem;
- };
-
- //========================================================================================
- // Class TDeepIterator
- //========================================================================================
- class TDeepIterator : public TAbstractObjectIterator
- {
- private:
- TAbstractScriptableObject* fRootItem;
- TAbstractObjectIterator** fIterStack;
- long fItersOnStack;
- long fStackSize;
- Boolean fDirection;
-
- public:
- virtual ~TDeepIterator();
-
- TDeepIterator(TAbstractScriptableObject* rootItem) :
- fRootItem(rootItem),
- fIterStack(nil),
- fItersOnStack(0),
- fStackSize(0),
- fDirection(kForwardIteration) {}
-
- void FocusOnNewRoot(TAbstractScriptableObject* newRoot) { fRootItem = newRoot; }
-
- //
- // Interface to code to:
- //
- virtual void Reset(const TAETransaction& t, Boolean iterationDirection = kForwardIteration);
- virtual Boolean More(const TAETransaction&) const;
- virtual void Next(const TAETransaction&);
- virtual TAbstractScriptableObject* Current(const TAETransaction&);
-
- virtual void AccessBySearchSpec(const TAETransaction& t, TAbstractCollector* collector, DescType desiredClass, TAbstractSearchSpec* searchSpec);
- virtual void SearchDeep(const TAETransaction& t, TAbstractCollector* collector, DescType desiredClass, TAbstractSearchSpec* searchSpec);
-
- private:
- TAbstractObjectIterator* TopIterator() const;
- TAbstractObjectIterator* PopIterator();
- void PushIterator(TAbstractObjectIterator* iter);
- void ClearIteratorStack();
-
- void PushSubtree(const TAETransaction& t, TAbstractScriptableObject* fromWhere);
- };
-
-
-
- #endif
-